package net.maku.framework.security.config;

import net.maku.framework.mybatis.handler.RemainingTimeHandler;
import org.springframework.web.socket.WebSocketHandler;
import org.springframework.web.socket.config.annotation.WebSocketConfigurer;
import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry;

/**
 * WebSocket 配置类，启用 WebSocket 支持。
 */
public class WebSocketConfig implements WebSocketConfigurer {
    @Override
    public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
        registry.addHandler((WebSocketHandler) new RemainingTimeHandler(),"/remainingTime")
                .setAllowedOrigins("*");
    }
}
